package com.kujie.listen;

import com.kujie.utils.HttpUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 项目启动监听器
 *
 * @author jyy
 * @date 2025-03-13
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class RestClientInitListener implements ApplicationListener<ApplicationStartedEvent> {

    /**
     * 项目启动时执行
     *
     * @param event 事件
     */
    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        log.info("初始化 RestClient 客户端");
        HttpUtils.init();
    }
}
